import { createRouter, createWebHashHistory } from "vue-router";

const routes = [
  {
    path: "/login",
    name: "login",
    component: () => import("@/views/login/login.vue"),
  },
  {
    path: "/about",
    name: "about",
    component: import("@/views/AboutView.vue"),
  },
  {
    path: "/lottery",
    name: "lottery",
    component: import("@/views/client/Lottery.vue"),
  },
  {
    path: "/",
    name: "首页",
    redirect: "/api/user/list",
    component: () => import("@/views/layout/layout.vue"),
    children: [
      {
        path: "/api/user/list",
        name: "用户管理",
        component: () => import("@/views/user/userList.vue"),
      },
      {
        path: "/api/role/list",
        name: "角色管理",
        component: () => import("@/views/role/roleList.vue"),
      },
      {
        path: "/api/interactiveActivity/list",
        name: "互动营销",
        component: () =>
          import("@/views/interactiveActivity/interactiveActivityList.vue"),
      },
    ],
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;
